{% extends 'base.html' %}
{% load static %}

{% block title %}我的粉丝 - Meet活动聚{% endblock %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-12">
            <div class="card shadow">
                <div class="card-header bg-info text-white">
                    <h4 class="mb-0"><i class="bi bi-people"></i> 我的粉丝</h4>
                </div>
                <div class="card-body">
                    {% if followers %}
                    <div class="list-group">
                        {% for follow in followers %}
                        <div class="list-group-item">
                            <div class="d-flex justify-content-between align-items-center">
                                <div class="d-flex align-items-center">
                                    {% if follow.follower.avatar %}
                                    <img src="{{ follow.follower.avatar.url }}" class="rounded-circle me-3" width="50" height="50" alt="{{ follow.follower.username }}">
                                    {% else %}
                                    <i class="bi bi-person-circle me-3" style="font-size: 2rem;"></i>
                                    {% endif %}
                                    <div>
                                        <h6 class="mb-1">{{ follow.follower.nickname|default:follow.follower.username }}</h6>
                                        <p class="mb-1 text-muted">{{ follow.follower.signature|default:"这个人很懒，什么都没有写" }}</p>
                                        <small class="text-muted">关注于 {{ follow.created_at|date:"Y-m-d" }}</small>
                                    </div>
                                </div>
                                <div>
                                    <a href="{% url 'users:user_profile' follow.follower.id %}" class="btn btn-sm btn-outline-primary me-1">
                                        <i class="bi bi-person"></i> 查看主页
                                    </a>
                                    <a href="{% url 'social:chat_main' %}" class="btn btn-sm btn-outline-success">
                                        <i class="bi bi-envelope"></i> 发消息
                                    </a>
                                </div>
                            </div>
                        </div>
                        {% endfor %}
                    </div>
                    {% else %}
                    <div class="text-center py-4">
                        <i class="bi bi-people" style="font-size: 4rem; color: #6c757d;"></i>
                        <h5 class="mt-3">暂无粉丝</h5>
                        <p class="text-muted">您还没有粉丝，多参与活动来吸引关注吧！</p>
                        <a href="{% url 'activities:activity_list' %}" class="btn btn-primary">
                            <i class="bi bi-search"></i> 去发现活动
                        </a>
                    </div>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}